﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<QianBuo.Lottery.Web.Models.UserInfoModel>" %>
<div class="toolbar_body" >
    <ul class="tool_items">
        <li><span>昵称：<%=Model.LoginName %></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         
          
            <hr class="tool_item_line" /></li>
             <% if (Model.EnableAddChildConfig && Model.ChildCount != null) %>
        <% { %>
        <li><span>
            配额：<span id="user_allchildcount"><%=Model.ChildCount.AllChildCount %></span>
            </span>
            <hr class="tool_item_line" />
        </li>
        <% } %>
        <li><span>余额：<span id="user_balance"><%=Model.Balance.ToString("F2") %></span></span><hr class="tool_item_line" /></li>
        <li><span>冻结：<span id="user_freez"><%=Model.Freez.ToString("F2") %></span></span><hr class="tool_item_line" /></li>
        <li><span>模式：<span id="user_winmodel"><%=Model.WinModelName %></span>&nbsp;&nbsp;<span id="user_ratio"><%=Model.RatioName %></span>模式</span><hr class="tool_item_line" /></li>
        <li><span>
            <a href='<%=Url.Action("Index","Pay") %>'><span class='top_div_06_btn'>充&nbsp;&nbsp;值</span></a>
            |
            <a href='<%=Url.Action("TakeMoney","User") %>'><span class='top_div_06_btn'>取&nbsp;&nbsp;款</span></a>
            |
            <a href='javascript:;' id="lblFreezMoney" onclick="return Freez_Click(false)"><span class='top_div_06_btn'>冻&nbsp;&nbsp;结</span></a>
            <a href='<%=Url.Action("FreezUserMoney","User") %>' style="display:none;" id="lblGetMoney"><span class='top_div_06_btn'>解&nbsp;&nbsp;冻</span></a></span>
            <hr class="tool_item_line" />
        </li>
       
        <%if (Code.BLL.CacheManage.OptionSite[Code.Models.Option_Site_Key.Site_Cache_Rating].ToBool(false))
          {%>             
         <%
              var Dang = Model.ThisEx;
              var ex = Model.Ex;
              var xian = 0;
              if (ex<=0)
              {
                  xian = 0;
              }
              if (ex>=Dang)
              {
                  xian=ex - Dang;
              }
           
          
           %>     
      <li><span>
      <%if (Dang < Model.Ex1)
        {%>
      等级:0<%} %>
       
      <%if (Dang>=Model.Ex1)
        {%>
           等级: <%=Model.Rans %> 
       <% } %>
      
      
      </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;经验值:<%=Dang %>  <hr class="tool_item_line" /></span></li> 
     
       <li> <% if (xian==0)
                     {%>
                        <span style="color:Red">恭喜您已经是满级了！  </span> 
                     <%} %>
                     <%if (xian>0)
                       {%>
                           <span>距离升级还有：<%=xian %>经验  </span>  
                      <% } %><hr class="tool_item_line" /></li> 
       <li style="width:75"><div style="width:100%;background-color:White" id="div2" >
           <img id="div1" src="../../Content/mg/img/menu-bg2.gif" height="5px" alt=""/></li>
         <%} %>
       
      
    </ul>
</div>
<script type="text/javascript">
    $(document).ready(
    function () {    
   var ex='<%=Model.ThisEx %>'; 
    var x='<%=Model.Ex %> ';
    var sas='<%=Model.GuanRank %>';
   
    if (sas=="False") {    
        return;
        }    else {
         if (x==0) {
    document.getElementById("div1").style.width="100%";
            }
  
        if (x>0) {
     document.getElementById("div1").style.width=(ex/x)*100+"%";  
            }
      
                } 
      
   
   });
  
    function ChageMoneyByFreeze(){
        var money=parseFloat('<%=Model.Balance.ToString("F2") %>');
        var freezmoney=parseFloat('<%=Model.Freez.ToString("F2") %>');
        $("#user_balance").text('余额:0.00');
        $("#user_freez").text('冻结:'+(money+freezmoney));
    }
    function Freez_Click(flag) {
        if(confirm('您确定要冻结？')){
            getJSON('<%=Url.Action("FreezMoney", "User")%>', null, function (result) {
                if (result.count > 0) {
                    $('#lblFreezMoney').hide();
                    $('#lblGetMoney').show();
                    ChageMoneyByFreeze();
                    alert('已冻结！');
                    if(flag)
                    location.href=location.href;
                }else if(result.msg.length>0){
                    alert(result.msg);
                }
            });
        }
        return false;
    }

    $(document).ready(function () { 
        var lbl1=$('#lblFreezMoney');
        var lbl2=$('#lblGetMoney');
        <%if (Model.IsFreez)
          { %>
            lbl1.hide();
            lbl2.show();
        <%}
          else
          { %>
            lbl1.show();
            lbl2.hide();
        <%} %>
    });
</script>

